/* Nokia 6100 Color LCD routines
   Author: Martin Maly, www.uelectronics.info, author@uelectronics.info

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


  Target: Luminary Micro LM3S811
  Family: ARM7-TDMI Cortex M3
  Compiler: Keil ARM C
*/
typedef unsigned char byte;
typedef unsigned short word;

#define LCD_WIDTH  131
#define LCD_HEIGTH 131

void LCD_clear(byte color);
void LCD_init(void);
void LCD_put_pixel(byte x,byte y,byte color);
void LCD_hline (byte x0,byte x1,byte y,byte color);
void LCD_vline (byte x,byte y0,byte y1,byte color);
void LCD_line ( byte x1, byte y1, byte x2, byte y2, byte color);
void LCD_send2(word color);
void LCD_char(byte x,byte y,word ink,word paper,byte n);
void LCD_string(byte x, byte y, word ink, word paper, char * str);
void LCD_blit(byte x,byte y,byte width,byte height,word *buffer);
void LCD_rectangle(byte x0,byte y0,byte x1,byte y1,byte color);
void LCD_circle(int xc, int yc, int r, byte color);
void LCD_circle_fill(int xc, int yc, int r, byte color);
void LCD_palette(void);
void LCD_8bpp(void);
void LCD_12bpp(void);
byte color8(word color);


//routines for 12bpp library
void sendData(byte data);
void sendCMD(byte data);

/* Epson S1D15G10 Command Set */
#define DISON       0xaf
#define DISOFF      0xae
#define DISNOR      0xa6
#define DISINV      0xa7
#define COMSCN      0xbb
#define DISCTL      0xca
#define SLPIN       0x95
#define SLPOUT      0x94
#define PASET       0x75
#define CASET       0x15
#define DATCTL      0xbc
#define RGBSET8     0xce
#define RAMWR       0x5c
#define RAMRD       0x5d
#define PTLIN       0xa8
#define PTLOUT      0xa9
#define RMWIN       0xe0
#define RMWOUT      0xee
#define ASCSET      0xaa
#define SCSTART     0xab
#define OSCON       0xd1
#define OSCOFF      0xd2
#define PWRCTR      0x20
#define VOLCTR      0x81
#define VOLUP       0xd6
#define VOLDOWN     0xd7
#define TMPGRD      0x82
#define EPCTIN      0xcd
#define EPCOUT      0xcc
#define EPMWR       0xfc
#define EPMRD       0xfd
#define EPSRRD1     0x7c
#define EPSRRD2     0x7d
#define NOP         0x25

